export default {
  methods:{// 根据渠道替换对应商品链接
    channelTypeLink(type) {
      const _protocol = location.protocol
      let link
      switch (type){
        case "pet":
          link = _protocol + '//petwxapp.tairanmall.com/item?item_id='
          break;
        case "trinstallment":
          link = _protocol + '//xtfq.tairanmall.com/item?channelType=trinstallment&item_id='
          break;
        case "trfd":
          link = _protocol + '//kdaf-m.tairanmall.com/item?item_id='
          break;
        case "51af":
          link = _protocol + '//51af-m.tairanmall.com/item?item_id='
          break;
        default:link =_protocol + '//www.tairanmall.com/item.html?item_id='
      }
      return link
    },
    itemLink(id, channel) {
      return (this.channelTypeLink(channel) + id)
    }
  }
}
